<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/sys/update/";  //应用的地址名
String listActionName = basePath+"SysUpdateInfo.action?op=searchjs";
String addActionName = basePath+"SysUpdateInfo_add.action";
String updateActionName = basePath+"SysUpdateInfo_update.action";
String delActionName = basePath+"SysUpdateInfo_del.action?op=deljs";
%>
<script type="text/javascript">
    		$(function(){
			//表格初始化
			$('#searchTable').grid({
				title:[<ce:menu/>],
				url:'<%=listActionName%>',
				queryParams:{"station":"","names":""},  //用于查询的参数以及初始值
				//表头列，不建议改动
				frozenColumns:[[   
	                {field:'ck',checkbox:true}
				]],
				//数据列，根据显示的内容进行修改
				columns:[[   
						{field:'dtUploadTime',title:'上传时间',width:120,sortable:true},
						{field:'userName',title:'上传人',width:80},
                        {field:'fileName',title:'升级包名',width:120,
			            formatter:function(value,row,index){return '<a href="<%=path%>/common/loadFile.jsp?vcId='+row.vcFileId+'">'+value+'</a>';}},
						{field:'vcUpdateDesc',title:'升级文件描述',width:160},
						{field:'dtUpdateTime',title:'升级更新时间',width:120,sortable:true}
						<ce:includeColum optName="update">
						,{field:'intUpdateFlag',title:'升级包更新',width:120,sortable:true,
			            formatter:function(value,row,index){return value==0?'<a href="javascript:updatePackage(\''+row.vcId+'\',\''+row.vcFileId+'\')"><img border="0" src="<%=path%>/js/jquery-easyui-1.2/themes/icons/up.png"/>更新</a>':'<font color="green">已更新</font>'}}
			            </ce:includeColum>
				]],
				//功能按钮组
                toolbar:[<ce:jsonBtn/>]
			});
			//查询操作
			$('#search').click(function(){
                defaultSearchAction();
            });		
		});	
		
		//点击添加按钮后的操作：打开添加界面
        function openAddPage(){
            //默认的打开添加界面操作(添加页面地址，窗口宽度，窗口高度)
            defaultOpenAddPageHavebtn('<%=addActionName%>',400,105);
		}
		//点击更新升级包按钮后进行的操作
		function updatePackage (vcId,fileId){
	      $.messager.confirm('系统更新警告', '<font color="red">进行升级更新操作时，务必在升级更新前做好程序代码备份工作！您确定要进行升级更新吗？<font>', function(r){
			if (r){
		       $.util.showLoading();
		       jQuery.post('<%=updateActionName%>',{chkSelf:vcId,fileId:fileId},function(data){
		           $.util.removeLoading();
		           returnOptMsg(data,null,'文件升级成功！');
		       });
		    }
		  });  
           
		}
		//删除数据操作
		function deleteItems(){
            defaultDeleteItems('<%=delActionName%>');
		}
		//点击帮助按钮后的操作：打开帮助界面
		function openHelpPage(){
		    defaultOpenWindow('<%=path%>/sys/menu/SysMenuHelp_look.action?chkSelf=<%=request.getAttribute("menuId").toString() %>','帮助信息查看',600,600);
		}
    
    </script>
<html>
  <head>
    <base href="<%=basePath%>"></base>
    <title><%=com.ce.util.RegeditUtil.getRegeditStringValue("SYSTEM_SEG_NAME") %></title>
  </head> 
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<table border="0" cellpadding="0" cellspacing="0" align="left" width="100%" height="100%">
<tr>
   <td><div id="searchTable"></div></td>
</tr>
</table>
</body>
</html>
   
   

